SNT file format description Released with mcc Synthesizer Version 1.00 A .SNT file begins always with the string "mcc Synth x.xx" (with final NUL, 15 bytes total), with x.xx the version number of the mcc Synthesizer. When reading, synth.exe does not control the version number. It pretends only the "mcc Synth" signature. After that modules follow. Each module begins with 4 bytes (a long integer), where the most significant byte identifies the module type, the other three bytes contain the module length (the module id (the described 4 bytes) is not counted). These type of modules are defined: ID 0 Length 0: File terminator. Not necessary, but synth.exe puts it. ID 1 Length variable: Text. You can put every text you want here (the module description, copyright messages, ...). synth.exe simply ignores it. ID 2 Lenght 1248: Sound bank. In given order: 12 * 31 bytes containing sound names (strings must terminate with NUL) 12 * 63 spectrum 12 * 8 ADSR pots (integers) 12 * 2 volume pots (integers) ID 3 Length 188899 Drum bank. In given order: 43 * 31 bytes containing drum names (strings must terminate with NUL) 43 * 256 spectrum 43 * 4096 sampled drums (spectrum converted to samples) 43 * 8 ADSR pots (integers) 43 * 2 volume pots (integers) ID 4 Length 104 Sound: 31 name 63 spectrum 8 ADSR 2 volume ID 5 Length 297 Drum: 31 name 256 spectrum 8 ADSR 2 volume ID 6 Lenght 41 Effect: 31 name 10 potentiometers ID 7 Length 11940 Rhythm bank: 12 * 2 rhythm potentiometers 12 * 31 names 12 * 2 number of passes (integer) 12 * 800 rhythm sequences 12 * 128 arrangements 12 * 32 LEDs ID 8 Length 995 Rhythm: 2 potentiometer 31 name 2 number of passes (integer) 800 rhythm sequence 128 arrangemet 32 LEDs ID 9 Length variable: Song: 2 rhythm number (0 to 11) 2 rhythm potentiometer 13 * 2 track offsets (integers, the last represents last track end + 1) 12 * 2 buttons (0 disabled, 1 play, 5 rec) 2 * offset[12] event times 2 * offset[12] events ID 10 Length 4393 Drum (with included sample): 31 name 256 spectrum 8 ADSR 2 volume 4096 sample IDs 11 - 127 reserved IDs 128 - 255 free All the potentiometers are integers. Acceptable values are in the range 0 - 155. ADSR pots are: attack time: pot ^ 2 * 1000 / 11232 ms release time: pot ^ 2 * 1000 / 11232 ms sustain level: pot ^ 2 / 241 % releases time: pot ^ 2 * 1000 / 11232 ms Effect pots are: delay time: pot ^ 2 / 54 ms delay level: pot ^ 2 / 246 % delay return: pot ^ 2 / 246 % delay modulation: pot ^ 2 / 246 % modulation period: pot ^ 2 * 12 / 45 ms Volume pot is: volume: pot / 1.56 % Rhythm pot is: BPM: pot ^ 2 / 50 + 2 The sound spectrum is made of unsigned chars in the range 0 - 180. The scales (intensity and frequency) are linear. The drums spectrum is made of unsigned chars in the range 0 - 63. The intensity scale is linear, the frequency scale is linear in portions of 48 frequencies. Every 48th frequency the scale doubles. To keep the ideas clear, here's the code that does the tranformation: n = k = 1; for(j = 1; j < 256; j++) { if(!(j% 48)) k *= 2; for(i = 0; i < k; i++) drum[n++] = spectrum[j] * (random(2000) - 1000); } 4096 poits FFT follows. What sampled is 8 bit signed char. The drum bank has the sampled data, because 43 4096-points FFTs are too long to calculate and the user doesn't want to wait one minute for every drum bank load. The rhythm sequence is a circular linked list of records containing four integers (in the given order): link to next node, time to next event, sound, note. Every pass is divided in 4 time units. Sounds go from 0 to 12, where 12 means drum. The bit 7 of note is set for release, cleared for press. Note number 127 is ignored. If sound is 12 (drum), note contains the drum (0 - 42). If sound is in the range 0 - 11, note contains the semitone number, where 67 is 440 Hz. Only 100 rhythm events are possible 800 / (2 * 4). Arrangement contains 4 sequences of 32 bytes, where each bit in the byte entry is used to determine, whether the note in the accord position corresponding to that bit will be played (if bit set). Bits 0 - 3 are actual accord positions, bits 4 - 7 play a note one octave higher. There are 4 sequences, the first for one key pressed, the second for two keys, and so on. For every pass there is a LED combination: 0 means first LED (red), 1 means the second (green), 2 the third (green), 3 the fourth (green) and 4 all the LEDs. The time unit for the songs is four times more precise than that of the rhythm, so there are 16 units for rhythm pass. The timing in the song is absolute (in the rhythm the timing entries represent the time between events). The events are integers with the most significant byte containing the sound and the least significant byte containg note. The sounds and the notes are as in the rhythm case.